<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/7/17
  Time: 10:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>图书列表</title>
</head>
<body>
    <h1>1. pageContext作用域</h1>
    <%
        Object obj = pageContext.getAttribute("books");
        out.println(obj);
    %>
    <h1>2. request作用域(开发中常用)</h1>
    <%
       List<String> books = (List<String>) request.getAttribute("books");
       out.println(books);
    %>
    <h1>3.session作用域</h1>
    <%
        List<String> books1 = (List<String>) session.getAttribute("books");
        out.println(books1 + "<br>");
        String id = session.getId();
        out.println("id = " + id);
    %>
    <h1>4.application作用域</h1>
    <%
        List<String> books2 = (List<String>) application.getAttribute("books");
        out.println(books2 + "<br>");
    %>
</body>
</html>
